package teamproject.visualization.gui.behaviors;

import teamproject.visualization.gui.visualobjects.Package;

public class PackageBufferBehavior implements Resettable {

	private int packageID;
	private Package packet;

	private boolean displayed = false;

	public PackageBufferBehavior(int packageID, Package packet) {
		this.packet = packet;
		this.packageID = packageID;
	}

	protected void doProcess() {
		packet.setAnimatedVisible(true);
		packet.setVisible(true);
	}

	public int getId() {
		return packageID;
	}

	public boolean isDisplayed() {
		return displayed;
	}

	@Override
	public void reset() {
		displayed = false;
	}

	public void setDisplayed(boolean displayed) {
		this.displayed = displayed;
		if (!displayed) {
			packet.setAnimatedVisible(false);
			packet.setVisible(false);
		}
	}

	public void setId(int packageID) {
		this.packageID = packageID;
	}
}
